var $addon={
	xpcom: Components.classes["@mozilla.org/extensions/manager;1"].getService(Components.interfaces.nsIExtensionManager),
	rdfs: Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService),
	get:function(id,key){
		if(!this.has(id)){
			return false;
		}
		
		switch(key){
			case "desc":
				var key="description";
				break;
			case "ver":
				var key="version";
				break;
			case "site":
				var key="homepageURL";
				break;
			case "creator":
				break;
		}
		var ds = $addon.xpcom.datasource;
		var val = ds.GetTarget($addon.rdfs.GetResource("urn:mozilla:item:"+id), $addon.rdfs.GetResource("http://www.mozilla.org/2004/em-rdf#"+key), true);
		return val.QueryInterface(Components.interfaces.nsIRDFLiteral).Value;
	},
	
	has:function(id){
		if(this.xpcom.getItemForID(id)){
			return true;
		}else{
			return false;
		}
	},
	find:function(id){
		if(!$addon.has(id)){return;}
		var items = this.xpcom.getItemList(Components.interfaces.nsIUpdateItem.TYPE_ADDON, {});
		for (var i = 0; i < items.length; i++) {
			$log.console(items[i].id);
			if (items[i].id==id){
				return items[i];
			}
		}
	},
	name:function(key){
		return this.find(key).name;
	},
	version:function(key){
		return this.find(key).version;
	},
	creator:function(key){
		return this.find(key).creator;
	},

}